import { createRouter, createWebHistory } from "vue-router";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      redirect:"/Login"
    },
    {
      path: "/Login",
      name: "Login",
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import("@/views/Login.vue"),
    },
    {
      path:"/Admin",
      name:"Admin",
      component:()=>import("@/views/Admin/Layout/Layout.vue"),
      children:[
        {
          path:"",
          component:()=>import("@/views/Admin/Index.vue")
        },
        {
          path:"BannerAdd",
          component:()=>import("@/views/Admin/Banner/BannerAdd.vue")
        },
        {
          path:"BannerList",
          component:()=>import("@/views/Admin/Banner/BannerList.vue")
        },
        {
          path:"UserAdd",
          component:()=>import("@/views/Admin/User/UserAdd.vue")
        },
        {
          path:"UserList",
          component:()=>import("@/views/Admin/User/UserList.vue")
        }
      ]
    }
  ],
});

export default router;
